package com.zx.cloud.controller.client;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.zx.cloud.Shift;
import com.zx.cloud.common.auth0.jwt.Token;
import com.zx.cloud.controller.StatusCode;
import com.zx.cloud.domain.Client;
import com.zx.cloud.domain.ClientAuth;
import com.zx.cloud.domain.CollegeDepartment;
import com.zx.cloud.domain.Dict;
import com.zx.cloud.domain.IdCardImg;
import com.zx.cloud.domain.Provinces;
import com.zx.cloud.domain.SmsMsg;
import com.zx.cloud.domain.VerifyMsg;
import com.zx.cloud.model.response.ObjectDataResponse;
import com.zx.cloud.model.response.Response;

/**
 * @author Alex
 */
@Component
public class ProviderClientFallback implements ProviderClient {
	
    private static final Logger LOGGER = LoggerFactory.getLogger(ProviderClientFallback.class);
	
    private void didNotGetResponse() {
        LOGGER.error("service '{}' has become unreachable", ProviderClient.SERVICE_ID);
    }

	@Override
	public ObjectDataResponse<Token> clientRegister(Client client) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Token> clientLogin(Client client) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	
	@Override
	public ObjectDataResponse<Integer> forgotPassword(Client client) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Integer> modifyPassword(Client client) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<ClientAuth> getClientAuth(Client client) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Integer> sendSMS(SmsMsg smsMsg) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Integer> verifyCode(SmsMsg smsMsg) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Token> refreshToken(Long userId) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<List<Dict>> getBanks() {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Integer> handleClientIDCardMsg(VerifyMsg verifyMsg) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<List<CollegeDepartment>> collegeMsg(Client client) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<List<Provinces>> provinceMsg(Client client) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<List<Dict>> getOccpation() {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<List<Dict>> getEducation() {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Integer> saveIDCardImg(IdCardImg idCardImg) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

}
